package org.eclipse.risk.views;


import gui.RiskGUI;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.part.ViewPart;

public class GameView extends ViewPart {

	public static RiskGUI gui;
	public static final String ID = "org.eclipse.risk.views.GameView";
	
	@Override
	public void createPartControl(Composite parent) {
		Composite inside = new Composite(parent,SWT.NONE);
		gui = new RiskGUI(inside, RiskGUI.RCP);
		makeMenu();
		gui.startGUI();
		initializeToolBar();
	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub
		
	}
	
	private void makeMenu(){
		IMenuManager menu = getViewSite().getActionBars().getMenuManager();
		Action newAction = new Action(){
			public void run(){
				gui.makePluginNewGame();
			}
		}; 
		menu.add(newAction);
		newAction.setText("new Game");
		
	}
	private void initializeToolBar() {
		IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
	}

}